/*
 * @Author: szx
 * @Date: 2021-10-20 12:57:40
 * @LastEditTime: 2021-10-20 13:15:05
 * @Description:
 * @FilePath: \leetcode\453\453.go
 */
package main

func minMoves(nums []int) int {
	min := nums[0]
	for _, num := range nums[1:] {
		if num < min {
			min = num
		}
	}
	ans := 0
	for _, num := range nums {
		ans += num - min
	}
	return ans
}

func main() {
	var arr []int = []int{1, 1, 1}
	print(minMoves(arr))
}
